<%
   count = 0
   if object[:errors] then
     errors = object[:errors]
     count = errors.count
   else
     errors = object.errors
     count = errors.count
     errors = object.errors.full_messages
   end
%>
<% if count > 0 then %>
  <div id="error_explanation">
    <h5><%= t 'activerecord.errors.title', count: count %></h5>
    <ul>
      <% errors.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
    </ul>
  </div>
<% end %>
